//
// Created by Semir on 2020/4/11.
//

#include <iostream>

using namespace std;

const int MAX_N = 10010;
const int MAX_V = 50000;
int v, n, c;
int k[MAX_N];
int m[MAX_N];
int dp[MAX_V];

void Solution1() {
    cin >> v >> n >> c;
    for (int i = 1; i <= n; i++) {
        cin >> k[i] >> m[i];
    }
    dp[0] = 0;
    for (int i = 1; i <= v; i++) {
        dp[i] = 10000000;
    }
    for (int i = 1; i <= n; i++) {
        for (int j = v; j >= 0; j--) {
            if (j - k[i] >= 0) {
                dp[j] = min(dp[j], dp[j - k[i]] + m[i]);
            } else {
                dp[j] = min(dp[j], m[i]);
            }
        }
    }
    if (c - dp[v] < 0) {
        cout << "Impossible" << endl;
    } else {
        cout << c - dp[v] << endl;
    }
}

void Solution2() {
    cin >> v >> n >> c;
    for (int i = 1; i <= n; i++) {
        cin >> k[i] >> m[i];
    }
    for (int i = 1; i <= n; i++) {
        for (int j = c; j >= m[i]; j--) {
            dp[j] = max(dp[j], dp[j - m[i]] + k[i]);
        }
    }
    for (int i = 0; i <= c; i++) {
        if (dp[i] >= v) {
            cout << c - i << endl;
            return;
        }
    }
    cout << "Impossible" << endl;
}

int main() {
    Solution2();
    return 0;
}